import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // 路由懒加载的写法
    {
      path: '/login',
      component: () => import('@/views/login/LoginPage.vue')
    },
    {
      // layout重定向
      path: '/',
      component: () => import('@/views/layout/LayoutContainer.vue'),
      redirect: '/artivle/manager',
      children: [
        {
          path: '/artivle/manager',
          component: () => import('@/views/artivle/ArtivleManager.vue')
        },
        {
          path: '/user/profile',
          component: () => import('@/views/user/UserProfile.vue')
        },
        {
          path: '/user/password',
          component: () => import('@/views/user/UserPassword.vue')
        },
        {
          path: '/user/avater',
          component: () => import('@/views/user/UserAvater.vue')
        }
      ]
    }
  ]
})

export default router
